Electronic device and method for controlling audio output thereof

ABSTRACT

In various embodiments, an electronic device comprises: a wireless communication module; a memory storing a priority of a plurality of external electronic devices; an output module; and a processor operatively connected to the wireless communication module, the memory, and the output module, wherein the processor is configured to: control the wireless communication module to establish a first wireless communication channel with a first external electronic device; control the wireless communication module to establish a second wireless communication channel with a second external electronic device; control the output module to output first audio data received through the first wireless communication channel; identify a priority of the first external electronic device and a priority of the second external electronic device when receiving second audio data through the second wireless communication channel while outputting the first audio data; identify a type of the first audio data and a type of the second audio data; adjust an output parameter of the first audio data and an output parameter of the second audio data based on the priority of the first external electronic device, the priority of the second external electronic device, the type of the first audio data, and the type of the second audio data; and output the first audio data using the adjusted output parameter of the first audio data and the second audio data using the adjusted output parameter of the second audio data through the output module. Various other embodiments are possible.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is based on and claims priority under 35 U.S.C. 119 toKorean Patent Application No. 10-2020-0020715, filed on Feb. 19, 2020,in the Korean Intellectual Property Office, the disclosure of which isincorporated by reference herein in its entirety.

BACKGROUND 1) Field

Various embodiments relate to an electronic device and a method forcontrolling an audio output thereof.

2) Description of Related Art

Electronic devices (for example, mobile terminals, smartphones, orwearable terminals) may provide various functions. The functions caninclude, for example and not limited to, a music playback function, anavigation function, a short-range wireless communication (e.g.,Bluetooth, Wi-Fi, or near-field communication (NFC)) function, afingerprint recognition function, and an electronic payment function.

Recent electronic devices may be connected to multiple externalelectronic devices in a wired or wireless manner. For example, anelectronic device may simultaneously establish wireless communicationchannels with multiple external electronic devices by using amulti-point technology, and may receive audio data from the multipleelectronic devices.

The above information is presented as background information only toassist with an understanding of the disclosure. No determination hasbeen made, and no assertion is made, as to whether any of the abovemight be applicable as prior art with regard to the disclosure.

SUMMARY

The electronic device may receive second audio data from a secondexternal electronic device while outputting first audio data receivedfrom a first external electronic device. The user may play music (secondaudio data) through the second external electronic device while music(first audio data) is already played through the first externalelectronic device. In such a case, the electronic device may maintainoutput of the first audio data and may mute output of the second audiodata. The foregoing may fail to reflect the intention of the user whowants to output the second audio data and mute the first audio data. Ifthe user wants the electronic device to switch from outputting the firstaudio data to outputting the second audio data, the user may have tostop output of the first audio data, or may have to request an outputchange through an input device of the electronic device.

In addition, the electronic device may mix and output the first audiodata and the second audio data without separate processing, therebymaking it difficult to identify to which external electronic devicespecific audio data corresponds.

Various embodiments may provide an electronic device capable ofcontrolling the output of audio data so as to reflect the user'sintention, and a method for controlling the audio output thereof.

In addition, Various embodiments may provide an electronic device and amethod for controlling the audio output thereof, wherein the user isenabled to distinguish an external electronic device corresponding toeach piece of audio data or to distinguish a piece of audio datacorresponding to each external electronic device.

In various embodiments, an electronic device comprises: a wirelesscommunication module; a memory storing a priority of a plurality ofexternal electronic devices; an output module; and a processoroperatively connected to the wireless communication module, the memory,and the output module, wherein the processor is configured to: controlthe wireless communication module to establish a first wirelesscommunication channel with a first external electronic device; controlthe wireless communication module to establish a second wirelesscommunication channel with a second external electronic device; controlthe output module to output first audio data received through the firstwireless communication channel; identify a priority of the firstexternal electronic device and a priority of the second externalelectronic device when receiving second audio data through the secondwireless communication channel while outputting the first audio data;identify a type of the first audio data and a type of the second audiodata; adjust an output parameter of the first audio data and an outputparameter of the second audio data based on the priority of the firstexternal electronic device, the priority of the second externalelectronic device, the type of the first audio data, and the type of thesecond audio data; and output the first audio data using the adjustedoutput parameter of the first audio data and the second audio data usingthe adjusted output parameter of the second audio data through theoutput module.

In various embodiments, a method for controlling audio output of anelectronic device, the method comprises: establishing a first wirelesscommunication channel with a first external electronic device;establishing a second wireless communication channel with a secondexternal electronic device; outputting, through an output module, firstaudio data received through the first wireless communication channel;identifying a priority of the first external electronic device and apriority of the second external electronic device when receiving secondaudio data through the second wireless communication channel whileoutputting the first audio data; identifying a type of the first audiodata and a type of the second audio data; adjusting an output parameterof the first audio data and an output parameter of the second audio databased on the priority of the first external electronic device and thepriority of the second external electronic device, the type of the firstaudio data, and the type of the second audio data; and outputting thefirst audio data using the adjusted output parameter of the first audiodata and the second audio data the adjusted output parameter of thesecond audio data through the output module.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other aspects, features, and advantages of certainembodiments of the disclosure will be more apparent from the followingdescription taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 illustrates an example in which an electronic device is connectedto a plurality of external electronic devices via wireless communicationaccording to an embodiment;

FIG. 2 illustrates an example of a user interface for prioritizationaccording to an embodiment;

FIG. 3 is a block diagram illustrating the configuration of anelectronic device according to an embodiment;

FIG. 4 is a flowchart illustrating a method for an electronic device tocontrol audio output according to an embodiment;

FIG. 5A illustrates an example in which an electronic device outputspieces of audio data according to an embodiment;

FIG. 5B illustrates an example in which an electronic device outputspieces of audio data according to an embodiment;

FIG. 5C illustrates an example in which an electronic device outputspieces of audio data according to an embodiment;

FIG. 5D illustrates an example in which an electronic device outputspieces of audio data according to an embodiment;

FIG. 5E illustrates an example in which an electronic device outputspieces of audio data according to an embodiment;

FIG. 5F illustrates an example in which an electronic device outputspieces of audio data according to an embodiment; and

FIG. 6 illustrates an example in which an electronic device provides asense of space according to an embodiment.

DETAILED DESCRIPTION

Hereinafter, various embodiments will be described with reference to theaccompanying drawings. Although specific embodiments are illustrated inthe drawings and a related detailed description is disclosed in thisdocument, these embodiments are not intended to limit variousembodiments disclosed herein to a specific form. For example, it will beapparent to those skilled in the art to which the disclosure pertainsthat various changes and modifications can be made to the embodiments.

FIG. 1 illustrates an example in which an electronic device is connectedto a plurality of external electronic devices via wireless communicationaccording to an embodiment, and FIG. 2 illustrates an example of a userinterface for prioritization according to an embodiment.

Referring to FIG. 1 and FIG. 2 , the electronic device 100 may receivefirst audio data 11 from a first external electronic device 10 andsecond audio data 21 from a second external electronic device 20. Theelectronic device 100 may initially output the first audio data 11 fromthe first external electronic device 10. While outputting the firstaudio data 11 from the first external electronic device 10, theelectronic device 100 may receive second audio data 21 from the secondexternal electronic device 20. The electronic device 100 may determine apriority for the first audio data 11 and the second audio data 21 basedon a type (e.g., ringtone, media, notification, system) and a prioritybased on the types of the first external electronic device 10 and thesecond external electronic device 20. The prioritization of the type canbe predetermined, such as listed in Table 1. Based on the priority, theelectronic device 100 can adjust the output parameter of the first audiodata 11 and the second audio data 21 in a manner that is likely toreflect user's intentions.

According to an embodiment, the electronic device 100 according to anembodiment may establish short-range wireless communication (e.g.,Bluetooth) with at least two external electronic devices 10 and 20. Forexample, the electronic device 100 may establish a first wirelesscommunication channel (or link) 11 with a first external electronicdevice 10 and may establish a second wireless communication channel (21)with a second external electronic device 20. According to an embodiment,the electronic device 100 may include, for example, a Bluetooth headset,Bluetooth earphones, and a Bluetooth speaker that are capable ofreceiving and outputting audio data from an external electronic device.The external electronic devices 10 and 20 may include, for example, asmartphone, a tablet PC, and a laptop computer that are capable oftransmitting audio data to the electronic device.

According to an embodiment, the electronic device 100 may supportmultipoint technology according to Bluetooth protocols. The firstwireless communication channel and the second wireless communicationchannel may be established using one of a plurality of profiles (e.g.,Advanced Audio Distribution Profile (A2DP), Audio/Video Remote ControlProfile (AVRCP)), Headset Profile (HSP), Hands-Free Profile (HFP), HumanInterface Device (HID), and Enhanced Data Rate (EDR)) supported by theBluetooth protocols. The first wireless communication channel and thesecond wireless communication channel may have the same profile ordifferent profiles.

According to an embodiment, the electronic device 100 may receive andoutput audio data from each of the plurality of external electronicdevices 10 and 20. For example, the electronic device 100 may receivefirst audio data from the first external electronic device 10 and mayoutput the received first audio data through an output module (e.g., aspeaker). The electronic device 100 may receive second audio data fromthe second external electronic device 20 while receiving and outputtingthe first audio data.

Upon receiving the second audio data, the electronic device 100 mayidentify the priority of the first external electronic device 10 and thesecond external electronic device 20 and/or the type of the first andsecond audio data. The type may be classified into at least two groups,and each group may include at least one subgroup. For example, the typemay be classified into ringtone, media, notification, and system typesas shown in Table 1.

TABLE 1 Type (group) Sound type (subgroup) Ringtone Ringtone Media Musicplayer, Video player, Radio, Text-to-speech (TTS) Notification SMS/MMS,E-mail, Calendar System Touch, Power, Lock/Unlock, Camera shutter sound,Video recording start/end, Charging start, Low battery

Table 1 is merely an example and does not limit embodiments disclosedherein. For example, the type may further include other groups (e.g.,Call) in addition to the ringtone, media, notification, and systemtypes.

In another example, at least some of the groups may be integrated intoand classified as one type. For example, the notification and mediatypes may be classified as the same group.

In still another example, at least some of the groups may be classifiedinto at least two groups. For example, the ringtone type may beclassified into a ringtone type specified by a user for a specificcounterpart or group (e.g., family, friends, and coworkers) and adefault ringtone type, the media type may not be classified, and thenotification type may be classified into a first sound effect indicatingreception of a push message associated with at least one applicationspecified by the user, a second sound effect indicating reception of apush message associated with an unspecified application, a third soundeffect (alarm sound) indicating a previously stored schedule or event,and a fourth sound effect associated with other notifications, and thesystem type may be classified into a first sound effect associated witha user input (e.g., a touch input), a second sound effect indicating thestate of the electronic device (e.g., power-on/off, a camera shuttersound, charging start, or low battery), and a third sound effectassociated with other system notifications.

In various embodiments, the highest priority can be assigned to aringtone, followed by media, followed by a notification of a message,calendar, and a system. In various embodiments, an incoming ringtone canautomatically mute all media.

The electronic device 100 may adjust an output parameter of the firstaudio data 11 and the second audio data 21 based on the identifiedpriority of the first and second external electronic devices 10 and 20and/or the identified type of the first audio data 11 and the secondaudio data 21. For example, the electronic device 100 may adjust thevolume of the first audio data 11 and the second audio data 21. Inanother example, the electronic device 100 may provide a sense of spaceby controlling output of the first audio data 11 and the second audiodata 21. A detailed description will be described with reference to FIG.5A to FIG. 6 .

The priority may be determined based on a connection history or aplayback history. For example, the electronic device 100 may set a highpriority for an external electronic device connected most recently or anexternal electronic device that has played audio data most recently.

The priority may be determined based on the type of audio data. Theelectronic device 100 may set the highest priority for an externalelectronic device that provides audio data corresponding to a ringtone.For example, the priority according to the type of audio data may be setas “ringtone>media>notification=system”. This example is merely forillustration and does not limit embodiments disclosed herein.

The priority may also be determined based on a predefined setting. Forexample, the electronic device 100 may prioritize a phone-type externalelectronic device, a tablet-type external electronic device, and awearable-type external electronic device in order based on thepredefined setting.

The priority may also be determined based on a user setting. Forexample, as illustrated in FIG. 2 , the electronic device 100 mayprovide a user interface 210 for prioritization when detecting that aplurality of external electronic devices is connected. The userinterface 210 may include a list 211 of the connected externalelectronic devices. The user may change the priority of a device on thelist by touching and dragging the device. For example, the user maychange a third item “iPhone X”, which is a third priority, to a secondpriority by touching and dragging the third item to a position betweenfirst and second items. In this case, a second priority “Galaxy WatchActive2” may be changed to a third priority. Various methods forchanging the priority may be used without being limited to the aboveexample.

When the electronic device 100 does not include a display as in FIG. 1 ,the user may perform prioritization using the first external electronicdevice 10 or the second external electronic device 20. For example, theuser interface 210 may be displayed on a display of the first externalelectronic device 10 or the second external electronic device 20.

FIG. 3 is a block diagram illustrating the configuration of anelectronic device, according to an embodiment.

Referring to FIG. 3 , the electronic device 300 (e.g., the electronicdevice 100) according to an embodiment may include a processor 310, amemory 320, a wireless communication module 330, and an output module340.

The wireless communication module 330 is configured to establishcommunication channels with the first external electronic device 10 andthe second external electronic device 20, as well as other externalelectronic devices. The wireless communication module 330 can receivefirst audio data 11, second audio data 21, as well as other audio dataover the communication channel. The processor 310 adjusts the outputparameter of the first audio data 11, second audio data 21, and anyother audio data. The output module 340 can include a speaker, andoutputs the first audio data 11, second audio data 21, and any otheraudio data according to the adjusted output parameters. The memory 320can store criteria for determining the adjusted output parameters. Forexample, the memory 320 can correlate media types and priorities, and/ordevices and priorities.

The processor 310 may control output of audio data to output module 340.For example, when audio data is received from a plurality of externalelectronic devices, the processor 310 may selectively output the audiodata or may mix and output the audio data based on the priority of theexternal electronic devices and the type of audio data. Alternatively,the processor 310 may output the audio data such that one of theexternal electronic devices, e.g., first external electronic device 10,sounds as if it is close to the electronic device 300, while the otherexternal electronic device, e.g., second external electronic device 20,is a distance away (now referred to as a “sense of space” is provided. Adetailed description will be described with reference to FIG. 4 to FIG.6 .

The memory 320 may store instructions that, when executed, cause theprocessor 310 to receive and output pieces of audio data from externalelectronic devices. The memory 320 may store the priority of connectedexternal electronic devices.

The wireless communication module 330 may establish a short-rangewireless communication channel with at least one external electronicdevice. For example, the wireless communication module 330 may be aBluetooth communication module.

The wireless communication module 330 may receive first audio data froma first external electronic device and may receive second audio datafrom a second external electronic device. Here, a frame transmitting thefirst audio data may include information about the type of the firstaudio data in a header. Further, a frame transmitting the second audiodata may include information about the type of the second audio data ina header.

When receiving the second audio data from the second external electronicdevice while outputting the first audio data, the wireless communicationmodule 330 may transmit a signal for requesting a pause in playback ofthe first audio data to the first external electronic device.

The output module 340 may output an audio signal corresponding to audiodata. For example, the output module 340 may be a speaker. The outputmodule 340 may include a plurality of speakers.

According to various embodiments of the disclosure, an electronic device(e.g., the electronic device 100, 300) may comprise: a wirelesscommunication module (e.g., the wireless communication module 330); amemory (e.g., the memory 320) configured to store a priority of aplurality of external electronic devices; an output module (e.g., theoutput module 340, such speaker(s)); and a processor (e.g., theprocessor 310) operatively connected to the wireless communicationmodule, the memory, and the output module. The processor may beconfigured to: control the wireless communication module to establish afirst wireless communication channel (e.g., the first wirelesscommunication channel 11) with a first external electronic device (e.g.,the first external electronic device 10); control the wirelesscommunication module to establish a second wireless communicationchannel (e.g., the second wireless communication channel 21) with asecond external electronic device (e.g., the second external electronicdevice 20); control the output module to output first audio datareceived through the first wireless communication channel; identify apriority of the first external electronic device and a priority of thesecond external electronic device when receiving second audio datathrough the second wireless communication channel while outputting thefirst audio data; identify a type of the first audio data and a type ofthe second audio data; adjust an output parameter of the first audiodata and an output parameter of the second audio data based on thepriority of the first external electronic device, the priority of thesecond external electronic device, the type of the first audio data, andthe type of the second audio data; and output the first audio data usingthe adjusted output parameter of the first audio data and the secondaudio data using the adjusted output parameter of the first audio datathrough the output module.

The processor may be further configured to determine the priority of thefirst external electronic device and the priority of the second externalelectronic device based on a connection history or a playback history,the type of the first audio data and the type of the second audio data,or a predefined setting or a user setting.

The type of the first audio data and the type of the second audio datamay be classified into at least two groups, and each group comprises atleast one subgroup.

The processor may be further configured to adjust the output parameterof the first audio data and the output parameter of the second audiodata by controlling a volume of the first audio data and a volume of thesecond audio data.

When the priority of the first external electronic device is high, theprocessor may be further configured to maintain the volume of the firstaudio data received from the first external electronic device and toreduce the volume of the second audio data received from the secondexternal electronic device by a specified value.

When receiving audio data of a media type from the second externalelectronic device while receiving and outputting audio data of a mediatype from the first external electronic device, the processor may befurther configured to request the first external electronic device topause playback of the audio data of the media type and to control theaudio data of the media type received from the second externalelectronic device to be output at a volume of 100%.

When receiving audio data of a media type from the second externalelectronic device while receiving and outputting audio data of a mediatype from the first external electronic device, the processor may befurther configured to change the volume of the audio data of the mediatype received from the first external electronic device to 0% and tocontrol the audio data of the media type received from the secondexternal electronic device to be output at a volume of 100%.

When receiving audio data of a media type from the second externalelectronic device while receiving and outputting audio data of a mediatype from the first external electronic device, the processor may befurther configured to change the volume of the audio data of the mediatype received from the first external electronic device to a specifiedvalue that is greater than 0% and is less than or equal to 100% and tocontrol the audio data of the media type received from the secondexternal electronic device to be output at a volume of 100%.

The processor may be further configured to adjust, when the firstexternal electronic device has a high priority and the second externalelectronic device has a low priority, the output parameter of the firstaudio data and the output parameter of the second audio data such thatthe first audio data and second output data are output at volumescorresponding to the first external device being closer to theelectronic device than the second external electronic device.

The processor may be further configured to identify a distance to eachexternal electronic device based on a strength of a wireless signal ofthe first external electronic device and a strength of a wireless signalof the second external electronic device and to adjust the outputparameter of the first audio data and the output parameter of the secondaudio data according to the identified distance to provide a sense ofspace.

FIG. 4 is a flowchart illustrating a method for an electronic device tocontrol audio output according to an embodiment.

Referring to FIG. 4 , in operation 401, a processor (e.g., the processor310) of an electronic device (e.g., the electronic device 100 or theelectronic device 300) according to an embodiment may establish acommunication channel with a plurality of electronic devices (e.g., thefirst external electronic device 10 and the second external electronicdevice 20). For example, the processor may establish a first wirelesscommunication channel with a first external electronic device and asecond wireless communication channel with a second external electronicdevice using a wireless communication module (e.g., the wirelesscommunication module 330). Here, the wireless communication module maybe a short-range wireless communication module (e.g., a Bluetoothcommunication module), and the first wireless communication channel andthe second wireless communication channel may be established using oneof a plurality of profiles supported by Bluetooth protocols. The firstwireless communication channel and the second wireless communicationchannel may be established using the same profile or different profiles.

In operation 403, the processor may output first audio data receivedfrom one of the plurality of external electronic devices. For example,when the first audio data is received from the first external electronicdevice through the first wireless communication channel, the processormay output the received first audio data through an output module (e.g.,the output module 340) (e.g., a speaker).

In operation 405, the processor may identify whether second audio datais received from another external electronic device. For example, theprocessor may identify whether the second audio data is received fromthe second external electronic device 20 through the second wirelesscommunication channel.

When no second audio data is received as a result of identification inoperation 405, the processor may maintain operation 405. According to anembodiment, when the first audio data is no longer received from thefirst external electronic device, the processor may return to operation403 and may wait to receive the first audio data from one of theplurality of external electronic devices.

When the second audio data is received as a result of identification inoperation 405, the processor may identify the priority of the externalelectronic devices in operation 407. The priority may be determinedbased on a connection history or a playback history, may be determinedbased on the type of audio data, or may be determined based on apredefined setting or a user setting.

In operation 409, the processor may identify the type of the first audiodata and the second audio data. The type may include ringtone, media,notification, and system types. This example is merely for illustrationand does not limit embodiments disclosed herein. For example, the typemay further include a new type in addition to the ringtone, media,notification, and system types, or at least some of these types may beintegrated into and classified as one type or may be subdivided into atleast two types. Information about the type may be included in a headerof a frame transmitting audio data.

In operation 411, the processor may adjust an output parameter of thefirst audio data and the second audio data based on the priority and thetype of the pieces of audio data. For example, the processor may controlat least one of the volume or a sense of space of the first audio dataand the second audio data. A detailed description will be described withreference to FIG. 5A to FIG. 6 .

In operation 413, the processor may output the first audio data and thesecond audio data through the output module based on the adjusted outputparameter.

Although not shown, when the first audio data or the second audio datais no longer received after operation 413, the processor may return tooperation prior to operation 403. For example, when the second audiodata is no longer received, the processor may return to operation 403and may output only the first audio data. Alternatively, when the firstaudio data is no longer received, the processor may return to operation403 and may output only the second audio data. In this case, the secondaudio data may replace the first audio data in operation 403.Alternatively, when the first audio data and the second audio data areno longer received after operation 413, the processor may return tooperation prior to operation 403 and may wait to receive the first audiodata.

FIG. 5A illustrates an example of outputting portions of audio dataaccording to an embodiment, FIG. 5B illustrates an example of outputtingpieces of audio data according to an embodiment, FIG. 5C illustrates anexample of outputting pieces of audio data according to an embodiment,FIG. 5D illustrates an example of outputting pieces of audio dataaccording to an embodiment, FIG. 5E illustrates an example of outputtingpieces of audio data according to an embodiment, and FIG. 5F illustratesan example of outputting pieces of audio data according to anembodiment.

Prior to a detailed description, it is assumed in FIG. 5A to FIG. 5Fthat a first external electronic device has a higher priority than asecond external electronic device.

Referring to FIG. 5A, when only first audio data 501 of a media type isreceived from the first external electronic device, an electronic device(e.g., the electronic device 100 or the electronic device 300) accordingto an embodiment may output the first audio data 501 at a volume of 100%(section A) (volume 100% shall be understood as being a same volume asif the audio data was the only audio data received).

According to various embodiments, when receiving second audio data 502of a ringtone type from the second external electronic device whileoutputting the first audio data 501 of the media type at a volume of100%, the electronic device may output the first audio data 501 and thesecond audio data 502 at a volume of N % (section B) (N % shall beunderstood as N % of the volume that the audio data would be played atif the audio data was the only audio data that was received). N may be apositive number less than 100. For example, the electronic device maygradually reduce (fade down) the volume of the first audio data 501 to N% and may then maintain N %, and may gradually increase (arise) thevolume of the second audio data 502 to N % and may then maintain N %.

When reception of the second audio data 502 of the ringtone typeterminates, the electronic device may gradually increase the volume ofthe first audio data from N % to 100% and may then maintain 100%(section C).

In various embodiments, first audio data 501 can be media, and secondaudio data 502 can be an audible alert system alert.

Referring to FIG. 5B, when only first audio data 511 of a media type isreceived from the first external electronic device, the electronicdevice according to an embodiment may output the first audio data 511 ata volume of 100% (section D).

According to various embodiments, when receiving second audio data 512of a notification type from the second external electronic device whileoutputting the first audio data 511 of the media type at a volume of100%, the electronic device may output the second audio data 512 at avolume of M % with the volume of the first audio data 511 maintained at100% (section E). M may be a positive number less than 100. In variousembodiments, first audio data 511 can be media, and second audio data512 can be an audible alert system alert.

Referring to FIG. 5C, when receiving second audio data 522 of a systemtype from the second external electronic device while outputting firstaudio data 521 of a media type received from the first externalelectronic device at a volume of 100%, the electronic device accordingto an embodiment may output the second audio data 522 at a volume of P %with the volume of the first audio data 521 maintained at 100% (sectionF). P may be a positive number less than 100.

In various embodiments, first audio data 511 can be media, and secondaudio data 512 can be a reception notification alert of an SMS.

Referring to FIG. 5D, when receiving second audio data 532 of a mediatype from the second external electronic device while outputting firstaudio data 531 of a media type received from the first externalelectronic device at a volume of 100%, the electronic device accordingto an embodiment may gradually reduce the volume of the first audio data531 to Q %, thus maintaining Q %, and may gradually increase the volumeof the second audio data 532 to 100%, thus maintaining 100% (section G).Q may be a positive number less than 100.

According to an embodiment, the electronic device may output the firstaudio data 531 at a volume of 100%. For example, Q may be 100. Accordingto another embodiment, the electronic device may output the first audiodata 531 at a volume of 0%. For example, Q may be 0. This embodiment maybe useful when the first audio data 531 is audio data included in avideo. For example, a user may enjoy music being played on the secondexternal electronic device through the electronic device while watchinga silent video on the first external electronic device.

According to an embodiment, when the second audio data of the media typeis received, the electronic device may request the first externalelectronic device to pause playback of the first audio data of the mediatype.

Referring to FIG. 5E, when receiving second audio data 542 of a mediatype from the second external electronic device while outputting firstaudio data 541 of a notification type received from the first externalelectronic device at a volume of 100%, the electronic device accordingto an embodiment may output the second audio data 542 at a volume of R %with the volume of the first audio data 541 maintained at 100% (sectionH). When output of the first audio data 541 is completed, the electronicdevice may gradually increase the volume of the second audio data 542from R % to 100% and may maintain output of the second audio data 542 at100% (section I).

Referring to FIG. 5F, when receiving second audio data 552 of a mediatype from the second external electronic device while outputting firstaudio data 551 of a system type received from the first externalelectronic device at a volume of 100%, the electronic device accordingto an embodiment may output the second audio data 552 at a volume of100% with the volume of the first audio data 551 maintained at 100%(section J). When output of the first audio data 551 is completed, theelectronic device may output the second audio data 552 at a volume of100% (section K).

FIG. 6 illustrates an example in which an electronic device provides asense of space according to an embodiment.

Referring to FIG. 6 , an electronic device (e.g., the electronic device100 or the electronic device 300) according to an embodiment may providea sense of space (or spatial audio) through various known techniques(e.g., an interaural time difference (ITD) technique using thedifference in arrival time of a sound between two ears or an interaurallevel difference (ILD) technique using the difference in loudnessbetween two ears). For example, the electronic device may provide asense of space by controlling an output parameter of first audio data611 and second audio data 612 in order to help a user feel as if anexternal electronic device having a high priority (e.g., the firstexternal electronic device 10) is located closer than an externalelectronic device having a low priority (e.g., the second externalelectronic device 20).

According to an embodiment, the electronic device may provide the senseof space based on the distance to the external electronic devices. Forexample, the electronic device may measure the strength of a receptionsignal received from each external electronic device through a wirelesscommunication module (e.g., the wireless communication module 330) andmay estimate the distance to each external electronic device based onthe measured strength of the reception signal. The electronic device maycontrol an output parameter of audio data received from each externalelectronic device based on the estimated distance, thereby providing asense of space.

According to an embodiment, when the electronic device can identify thedirection of each external electronic device or can receive thedirection of each external electronic device through another connectedexternal electronic device (e.g., an IoT device), the electronic devicemay provide a sense of space in consideration of the distance and/ordirection of each external electronic device.

According to various embodiments, a method for controlling audio outputof an electronic device (e.g., the electronic device 100, 300) maycomprise: establishing a first wireless communication channel (e.g., thefirst wireless communication channel 11) with a first externalelectronic device (e.g., the first external electronic device 10);establishing a second wireless communication channel (e.g., the secondwireless communication channel 21) with a second external electronicdevice (e.g., the second external electronic device 20); outputting,through an output module (e.g., the output module 340), first audio datareceived through the first wireless communication channel; identifying apriority of the first external electronic device and a priority of thesecond external electronic device when receiving second audio datathrough the second wireless communication channel while outputting thefirst audio data; identifying a type of the first audio data and a typeof the second audio data; adjusting an output parameter of the firstaudio data and an output parameter of the second audio data based on thepriority of the first external electronic device and the priority of thesecond external electronic device, the type of the first audio data, andthe type of the second audio data; and outputting the first audio datausing the adjusted output parameter of the first audio data and thesecond audio data the adjusted output parameter of the second audio datathrough the output module.

According to various embodiments, the identifying of the priorities maycomprise one of: determining the priority of the first externalelectronic device and the priority of the second external electronicdevice based on a connection history or a playback history; determiningthe priority of the first external electronic device and the priority ofthe second external electronic device based on the type of the firstaudio data and the type of the second audio data; or determining thepriority of the first external electronic device and the priority of thesecond external electronic device based on a predefined setting or auser setting.

According to various embodiments, the type of the first audio data andthe type of the second audio data are classified into at least twogroups, and each group comprises at least one subgroup.

According to various embodiments, the adjusting of the output parameterof the first audio data and the second audio data may comprise:controlling a volume of the first audio data and a volume of the secondaudio data.

According to various embodiments, the controlling of the volumes maycomprise: maintaining, when the priority of the first externalelectronic device is high, the volume of the first audio data receivedfrom the first external electronic device 100% and reducing the volumeof the second audio data received from the second external electronicdevice by a specified value.

According to various embodiments, the controlling of the volumes maycomprise: requesting, when receiving audio data of a media type from thesecond external electronic device while receiving and outputting audiodata of a media type from the first external electronic device, thefirst external electronic device to pause playback of the audio data ofthe media type and controlling the audio data of the media type receivedfrom the second external electronic device to be output at a volume of100%.

According to various embodiments, the controlling of the volumes maycomprise: changing, when receiving audio data of a media type from thesecond external electronic device while receiving and outputting audiodata of a media type from the first external electronic device, thevolume of the audio data of the media type received from the firstexternal electronic device to 0% and controlling the audio data of themedia type received from the second external electronic device to beoutput at a volume of 100%.

According to various embodiments, the controlling of the volumes maycomprise: changing, when receiving audio data of a media type from thesecond external electronic device while receiving and outputting audiodata of a media type from the first external electronic device, thevolume of the audio data of the media type received from the firstexternal electronic device to a specified value that is greater than 0%and is less than or equal to 100% and controlling the audio data of themedia type received from the second external electronic device to beoutput at a volume of 100%.

According to various embodiments, the adjusting of the output parametersmay comprise: adjusting, when the first external device has a highpriority and the second external device has a low priority, the outputparameter of the first audio data and the output parameter of the secondaudio data such that the first audio data and second output data areoutput at volumes corresponding to the first external device beingcloser to the electronic device than the second external electronicdevice. According to various embodiments, the adjusting of the outputparameters may comprise: identifying a distance to each externalelectronic device based on a strength of a wireless signal of the firstexternal electronic device and a strength of a wireless signal of thesecond external electronic device; and adjusting the output parameter ofthe first audio data and the output parameter of the second audio dataaccording to the identified distance to provide a sense of space.

An electronic device according to various embodiments may control theaudio output so as to reflect the user's intention when pieces of audiodata are received from multiple external electronic devices. Inaddition, the electronic device may provide a sense of space such thatthe user can recognize external electronic devices corresponding topieces of audio data that are being output.

The electronic device according to various embodiments may be one ofvarious types of electronic devices that may receive and output audiosignals from multiple external electronic devices. The electronicdevices may include, for example, a portable communication device (e.g.,a smartphone), a computer device, a portable multimedia device, aportable medical device, a camera, a wearable device, a home appliance,or the like. According to an embodiment of the disclosure, theelectronic devices are not limited to those described above.

It should be appreciated that various embodiments of the presentdisclosure and the terms used therein are not intended to limit thetechnological features set forth herein to particular embodiments andinclude various changes, equivalents, or replacements for acorresponding embodiment. With regard to the description of thedrawings, similar reference numerals may be used to refer to similar orrelated elements. It is to be understood that a singular form of a nouncorresponding to an item may include one or more of the things, unlessthe relevant context clearly indicates otherwise. As used herein, eachof such phrases as “A or B,” “at least one of A and B,” “at least one ofA or B,” “A, B, or C,” “at least one of A, B, and C,” and “at least oneof A, B, or C,” may include any one of, or all possible combinations ofthe items enumerated together in a corresponding one of the phrases. Asused herein, such terms as “1st” and “2nd,” or “first” and “second” maybe used to simply distinguish a corresponding component from another,and does not limit the components in other aspect (e.g., importance ororder). It is to be understood that if an element (e.g., a firstelement) is referred to, with or without the term “operatively” or“communicatively”, as “coupled with,” “coupled to,” “connected with,” or“connected to” another element (e.g., a second element), the element maybe coupled with the other element directly (e.g., wiredly), wirelessly,or via a third element.

As used in connection with various embodiments of the disclosure, theterm “module” may include a unit implemented in hardware, software, orfirmware, or any combination thereof, and may interchangeably be usedwith other terms, for example, “logic,” “logic block,” “part,” or“circuitry”. A module may be a single integral component, or a minimumunit or part thereof, adapted to perform one or more functions. Forexample, according to an embodiment, the module may be implemented in aform of an application-specific integrated circuit (ASIC).

Various embodiments as set forth herein may be implemented as softwareincluding one or more instructions that are stored in a storage medium(e.g., the memory 320) that is readable by a machine (e.g., theelectronic device 100, 300). For example, a processor (e.g., theprocessor 310) of the machine (e.g., the electronic device 100, 300) mayinvoke at least one of the one or more instructions stored in thestorage medium, and execute it, with or without using one or more othercomponents under the control of the processor. This allows the machineto be operated to perform at least one function according to the atleast one instruction invoked. The one or more instructions may includea code generated by a complier or a code executable by an interpreter.The machine-readable storage medium may be provided in the form of anon-transitory storage medium. Wherein, the “non-transitory” storagemedium is a tangible device, and may not include a signal (e.g., anelectromagnetic wave), but this term does not differentiate betweenwhere data is semi-permanently stored in the storage medium and wherethe data is temporarily stored in the storage medium.

According to an embodiment, a method according to various embodiments ofthe disclosure may be included and provided in a computer programproduct. The computer program product may be traded as a product betweena seller and a buyer. The computer program product may be distributed inthe form of a machine-readable storage medium (e.g., compact disc readonly memory (CD-ROM)), or be distributed (e.g., downloaded or uploaded)online via an application store (e.g., PlayStore™), or between two userdevices (e.g., smart phones) directly. If distributed online, at leastpart of the computer program product may be temporarily generated or atleast temporarily stored in the machine-readable storage medium, such asmemory of the manufacturer's server, a server of the application store,or a relay server.

According to various embodiments, each component (e.g., a module or aprogram) of the above-described components may include a single entityor multiple entities, and some of the multiple entities may beseparately disposed in different components. According to variousembodiments, one or more of the above-described components may beomitted, or one or more other components may be added. Alternatively oradditionally, a plurality of components (e.g., modules or programs) maybe integrated into a single component. In such a case, according tovarious embodiments, the integrated component may still perform one ormore functions of each of the plurality of components in the same orsimilar manner as they are performed by a corresponding one of theplurality of components before the integration. According to variousembodiments, operations performed by the module, the program, or anothercomponent may be carried out sequentially, in parallel, repeatedly, orheuristically, or one or more of the operations may be executed in adifferent order or omitted, or one or more other operations may beadded.

What is claimed is:
 1. An electronic device comprising: a wirelesscommunication module; a memory storing a priority of a plurality ofexternal electronic devices; an output module; and a processoroperatively connected to the wireless communication module, the memory,and the output module, wherein the processor is configured to: controlthe wireless communication module to establish a first wirelesscommunication channel with a first external electronic device; controlthe wireless communication module to establish a second wirelesscommunication channel with a second external electronic device, whilethe first wireless communication channel is established with the firstexternal electronic device; control the output module to output firstaudio data having a first volume, the first audio data being receivedthrough the first wireless communication channel from the first externalelectronic device; receive second audio data through the second wirelesscommunication channel from the second external electronic device whileoutputting the first audio data having the first volume; identify apriority of the first external electronic device and a priority of thesecond external electronic device based on a connection history or aplayback history when receiving the second audio data through the secondwireless communication channel while outputting the first audio data;identify a type of the first audio data and a type of the second audiodata; gradually reduce percentage of a volume of the first audio dataover a predetermined time to reduce the first volume of the first audiodata to a second volume and gradually increase percentage of a volume ofthe second audio data over the predetermined time to increase the volumeof the second audio data to the first volume, the first volume beinggreater than the second volume based on the priority of the firstexternal electronic device, the priority of the second externalelectronic device, the type of the first audio data, and the type of thesecond audio data; and output the first audio data having the secondvolume and the second audio data having the first volume through theoutput module.
 2. The electronic device of claim 1, wherein theprocessor is further configured to: determine the priority of the firstexternal electronic device and the priority of the second externalelectronic device based on a predefined setting or a user setting. 3.The electronic device of claim 1, wherein the type of the first audiodata and the type of the second audio data are classified into at leasttwo groups, and each group comprises at least one subgroup.
 4. Theelectronic device of claim 1, wherein the processor is furtherconfigured to adjust an output parameter of the first audio data and anoutput parameter of the second audio data by controlling a volume of thefirst audio data and the volume of the second audio data.
 5. Theelectronic device of claim 4, wherein, when the priority of the firstexternal electronic device is high, the processor is further configuredto maintain the first volume of the first audio data and to reduce thevolume of the second audio data to the second volume.
 6. The electronicdevice of claim 4, wherein, when receiving audio data of a media typefrom the second external electronic device while receiving andoutputting audio data of a media type from the first external electronicdevice, the processor is further configured to request the firstexternal electronic device to pause playback of the audio data of themedia type and to control the audio data of the media type received fromthe second external electronic device to be output at a volume of 100%.7. The electronic device of claim 4, wherein, when receiving audio dataof a media type from the second external electronic device whilereceiving and outputting audio data of a media type from the firstexternal electronic device, the processor is further configured tochange the volume of the audio data of the media type received from thefirst external electronic device to 0% and to control the audio data ofthe media type received from the second external electronic device to beoutput at a volume of 100%.
 8. The electronic device of claim 4,wherein, when receiving audio data of a media type from the secondexternal electronic device while receiving and outputting audio data ofa media type from the first external electronic device, the processor isfurther configured to change the volume of the audio data of the mediatype received from the first external electronic device to a specifiedvalue that is greater than 0% and is less than or equal to 100% and tocontrol the audio data of the media type received from the secondexternal electronic device to be output at a volume of 100%.
 9. Theelectronic device of claim 4, wherein the processor is furtherconfigured to adjust, when the first external electronic device has ahigh priority and the second external electronic device has a lowpriority, the output parameter of the first audio data and the outputparameter of the second audio data such that the first audio data andsecond audio data are output at volumes corresponding to the firstexternal electronic device being closer to the electronic device thanthe second external electronic device.
 10. The electronic device ofclaim 1, wherein the processor is further configured to identify adistance to each external electronic device based on a strength of awireless signal of the first external electronic device and a strengthof a wireless signal of the second external electronic device and toadjust an output parameter of the first audio data and an outputparameter of the second audio data according to the identified distanceto provide a sense of space.
 11. A method for controlling audio outputof an electronic device, the method comprising: establishing a firstwireless communication channel with a first external electronic device;establishing a second wireless communication channel with a secondexternal electronic device, while the first wireless communicationchannel is established with the first external electronic device;outputting, through an output module, first audio data having a firstvolume, the first audio data being received through the first wirelesscommunication channel from the first external electronic device;receiving second audio data through the second wireless communicationchannel from the second external electronic device while outputting thefirst audio data having the first volume; identifying a priority of thefirst external electronic device and a priority of the second externalelectronic device based on a connection history or a playback historywhen receiving the second audio data through the second wirelesscommunication channel while outputting the first audio data; identifyinga type of the first audio data and a type of the second audio data;gradually reducing percentage of a volume of the first audio data over apredetermined time to reduce the first volume of the first audio data toa second volume, and gradually increasing percentage of a volume of thesecond audio data over the predetermined time to increase the volume ofthe second audio data to the first volume, the first volume beinggreater than the second volume based on the priority of the firstexternal electronic device and the priority of the second externalelectronic device, the type of the first audio data, and the type of thesecond audio data; and outputting the first audio data having the secondvolume and the second audio data having the first volume through theoutput module.
 12. The method of claim 11, wherein identifying of thepriorities comprises of: determining the priority of the first externalelectronic device and the priority of the second external electronicdevice based on a predefined setting or a user setting.
 13. The methodof claim 11, wherein the type of the first audio data and the type ofthe second audio data are classified into at least two groups, and eachgroup comprises at least one subgroup.
 14. The method of claim 11,further comprising: adjusting an output parameter of the first audiodata and an output parameter of the second audio data by controlling avolume of the first audio data and the volume of the second audio data.15. The method of claim 14, wherein controlling the volumes comprises:when the priority of the first external electronic device is high,maintaining the first volume of the first audio data and reducing thevolume of the second audio data to the second volume.
 16. The method ofclaim 14, wherein controlling the volumes comprises: when receivingaudio data of a media type from the second external electronic devicewhile receiving and outputting audio data of a media type from the firstexternal electronic device, requesting the first external electronicdevice to pause playback of the audio data of the media type andcontrolling the audio data of the media type received from the secondexternal electronic device to be output at a volume of 100%.
 17. Themethod of claim 14, wherein controlling the volumes comprises: whenreceiving audio data of a media type from the second external electronicdevice while receiving and outputting audio data of a media type fromthe first external electronic device, changing the volume of the audiodata of the media type received from the first external electronicdevice to 0% and controlling the audio data of the media type receivedfrom the second external electronic device to be output at a volume of100%.
 18. The method of claim 14, wherein controlling the volumescomprises: when receiving audio data of a media type from the secondexternal electronic device while receiving and outputting audio data ofa media type from the first external electronic device, changing thevolume of the audio data of the media type received from the firstexternal electronic device to a specified value that is greater than 0%and is less than or equal to 100% and controlling the audio data of themedia type received from the second external electronic device to beoutput at a volume of 100%.
 19. The method of claim 14, whereinadjusting the output parameters comprises: adjusting, when the firstexternal electronic device has a high priority and the second externalelectronic device has a low priority, the output parameter of the firstaudio data and the output parameter of the second audio data such thatthe first audio data and second output data are output at volumescorresponding to the first external electronic device being closer tothe electronic device than the second external electronic device. 20.The method of claim 14, wherein adjusting the output parameterscomprises: identifying a distance to each external electronic devicebased on a strength of a wireless signal of the first externalelectronic device and a strength of a wireless signal of the secondexternal electronic device; and adjusting an output parameter of thefirst audio data and an output parameter of the second audio dataaccording to the identified distance to provide a sense of space.